# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Run.V2.Model.GoogleCloudRunV2VpcAccess do
  @moduledoc """
  VPC Access settings. For more information on sending traffic to a VPC network, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

  ## Attributes

  *   `connector` (*type:* `String.t`, *default:* `nil`) - VPC Access connector name. Format: `projects/{project}/locations/{location}/connectors/{connector}`, where `{project}` can be project id or number. For more information on sending traffic to a VPC network via a connector, visit https://cloud.google.com/run/docs/configuring/vpc-connectors.
  *   `egress` (*type:* `String.t`, *default:* `nil`) - Optional. Traffic VPC egress settings. If not provided, it defaults to PRIVATE_RANGES_ONLY.
  *   `networkInterfaces` (*type:* `list(GoogleApi.Run.V2.Model.GoogleCloudRunV2NetworkInterface.t)`, *default:* `nil`) - Optional. Direct VPC egress settings. Currently only single network interface is supported.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :connector => String.t() | nil,
          :egress => String.t() | nil,
          :networkInterfaces =>
            list(GoogleApi.Run.V2.Model.GoogleCloudRunV2NetworkInterface.t()) | nil
        }

  field(:connector)
  field(:egress)

  field(:networkInterfaces,
    as: GoogleApi.Run.V2.Model.GoogleCloudRunV2NetworkInterface,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.Run.V2.Model.GoogleCloudRunV2VpcAccess do
  def decode(value, options) do
    GoogleApi.Run.V2.Model.GoogleCloudRunV2VpcAccess.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Run.V2.Model.GoogleCloudRunV2VpcAccess do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
